Page({
  data: {
    items: [],
    id: '',
  },
  onLoad(option) {
    this.setData({
      id: option.id,
    })
    this.loadData();
  },
  onShow() {
    if (this.data.id != '') {
      this.loadData();
    }
  },
  loadData() {
    dd.showLoading({
      content: '加载中...',
      delay: 1000,
    });
    var that = this;
    dd.httpRequest({
      url: 'http://www.ejzcat.com/dingapi/equipmentrepair/evaluatememo.ashx',
      method: 'POST',
      data: {
        type: 'get',
        repairId: that.data.id,
      },
      dataType: 'json',
      success: function(res) {
        that.setData({
          items: res.data,
        })
      },
      fail: function(err) {
        dd.alert({ content: JSON.stringify(err) });
      },
      complete: function() {
        dd.hideLoading();
      }
    })
  },
  openModal() {
    dd.navigateTo({
      url: '../../../mypages/equipment/messageform/messageform?id=' + this.data.id,
    })
  },
});
